<%@ page import="java.util.Date" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
		 pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>全省普通公路项目省补、车购税结存资金情况单位统计表</title>
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/Top.css" />
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/style.css" />
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/easyui/themes/default/easyui.css" />
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/easyui/themes/icon.css" />
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/buttons.css" />
	<script type="text/javascript" src="${pageContext.request.contextPath}/easyui/jquery-1.9.1.min.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/easyui/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/easyui/datagrid-detailview.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/easyui/easyui-lang-zh_CN.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/js/util/jquery.cookie.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/js/YMLib.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/js/YWLib.js"></script>
	<style type="text/css">
		<!--
		a:link {text-decoration: none;}
		a:visited {text-decoration: none;}
		a:hover {text-decoration: none;}
		a:active {text-decoration: none;}
		#bbtable {border-collapse:collapse;}
		#bbtable thead tr td {text-align:center;font-size:1em;font-weight:bold;border:1px solid #FFEBCD;}
		#bbtable tbody tr td {text-align:center;font-size:1em;border:1px solid #FFEBCD;}
		
		
		-->
		
		
		
	</style>
	<script type="text/javascript">
	$(function(){
		var currYear = new Date().getFullYear();
		$("#currYearTo2").html(currYear-2+'年及以前');
		$("#currYearTo1").html(currYear-1+'年');
		$("#currYear").html(currYear+'年');
		// loadDist1("xzqh",$.cookie("dist"));
		// loadUnit1("gydw",$.cookie("unit"));
		loadBmbm3('jhnf','项目年份',new Date().getFullYear());

		loadGhny('ghny');
		// loadBmbm3('xmlx','报表项目类型');
		// var nf=new Date().getFullYear()
		// var yf=new Date().getMonth()+1 < 10 ? '0'+(new Date().getMonth()+1):new Date().getMonth()+1;
		// var day=new Date().getDate() < 10 ? '0'+new Date().getDate():new Date().getDate();
		// if($.cookie('unit')=='36'){
		// 	 $("#sfxszrc2").attr("checked","checked");
		// 	  $("#sfxszrc1").removeAttr("checked");
		// }else{
		// 	 $("#sfxszrc2").attr("checked","checked");
		// 	 $("#sfxszrc1").removeAttr("checked");
		// }
		
		
		// $("#bbsj").datebox("setValue",nf+"-"+yf+"-"+day);
		
	});
		
	var str1="";var str2="";var datalist;
	
	function showBb(bs){
		// addBbTj($.cookie("unit"),"全省普通公路项目省补、车购税结存资金情况单位统计表",$("#bbsj").datebox("getValue").substring(0,7));
		var tbody = $("#bblist");
				tbody.empty();
		var flag =0;
		flag = bs;
		var ghny = $("#ghny").combobox('getValue');
		if(bs==2){
			if(ghny==''||ghny==null){
				alert("固化年月不能为空");
				return false;
			}
		}

		loadjzt();

		var str="v_0,v_1,v_2,v_3,v_4,v_5,v_6,v_7,v_8,v_9,v_10,v_11,v_12,v_13,v_14,v_15";

		var ss=str.split(",");



		// var xzqhdm=$("#xzqh").combotree("getValues");
		// if(xzqhdm.length==0){
		// 	xzqhstr= $.cookie("dist2");
		//
		// }else if(xzqhdm.length==1){
		// 	if(xzqhdm[0].substr(xzqhdm[0].length-2,xzqhdm[0].length)=="00") xzqhdm[0]=xzqhdm[0].substr(0,xzqhdm[0].length-2);
		// 	if(xzqhdm[0].substr(xzqhdm[0].length-2,xzqhdm[0].length)=="00") xzqhdm[0]=xzqhdm[0].substr(0,xzqhdm[0].length-2);
		// 	xzqhstr=xzqhdm[0] ;
		// }else{
		// 	xzqhstr= xzqhdm.join(',');
		// }
		//
		// var gydwdm=$("#gydw").combotree("getValues");
		// if(gydwdm.length==0){
		// 	gydwstr= $.cookie("unit2");
		//
		// }else if(gydwdm.length==1){
		// 	if(gydwdm[0].substr(gydwdm[0].length-2,gydwdm[0].length)=="00") gydwdm[0]=gydwdm[0].substr(0,gydwdm[0].length-2);
		// 	if(gydwdm[0].substr(gydwdm[0].length-2,gydwdm[0].length)=="00") gydwdm[0]=gydwdm[0].substr(0,gydwdm[0].length-2);
		// 	gydwstr=gydwdm[0] ;
		// }else{
		// 	gydwstr= gydwdm.join(',');
		// }
		//
		//
		// var xmlx=$("#xmlx").combobox("getValues").join(",");
		// if(xmlx.substr(0,1)==',')
		// 	xmlx=xmlx.substr(1,xmlx.length);


		$.ajax({
			url:"/jxcsxm/tjbb/qsptglxmsbcgsjczjqkb.do",
			data:'flag='+flag+'&jhnf='+getValuesById("jhnf")+'&ghny='+ghny,
			// +"&xmlx="+xmlx+"&xzqhdm="+xzqhstr+"&sbthcd="+$.cookie("unit2").length+"&gydw="+gydwstr+"&bbsj="+$("#bbsj").datebox("getValue")+"&xmdj="+$("#xmdj").val(),
			type:"post",
			dataType:"JSON",
			success:function(msg){
				datalist=msg;
				disLoadjzt();
				if (msg != null) {

					for ( var i = 0; i < msg.length; i++) {
						var tr="<tr height='28'>";
						for ( var j = 0; j < ss.length; j++) {
							if(msg[i][ss[j]] === '合计'){
								if(j==0)
									tr+="<td style='width:200px;background: #FFF5EE;font-weight: 800;'>"+msg[i][ss[j]]+"</td>";
								else
									tr+="<td style='width:35px;'>"+msg[i][ss[j]]+"</td>";
							}else{
								if(j==0){
									tr+="<td style='width:200px;'>"+msg[i][ss[j]]+"</td>";
								}else{
									if(msg[i][ss[0]] != '合计'){
										tr+="<td style='width:30px;'>"+msg[i][ss[j]]+"</td>";
									}else{
										tr+="<td style='width:30px;background: #FFF5EE;font-weight: 800;'>"+msg[i][ss[j]]+"</td>";
									}


								}
							}


						}
						tr+="</tr>";

						tbody.append(tr);
					}
				}
			}
		});
	}
	
	function exportBb(){
		console.log("datalist===="+datalist);
		if(datalist==""|| datalist== undefined){
			alert("请您先查询报表数据");
			return;
		}
		  // var data="flag=1&ssbb=ptglxmzjxqqkb"+"&sbthcd="+$.cookie("unit2").length+"&gydw="+$.cookie("truename")+"&bbsj="+$("#bbsj").datebox("getValue");
		  var data='flag=1&jhnf='+getValuesById("jhnf");
			loadjzt();
			 $.post('/jxcsxm/xtgl/exportBb_set.do',{nameValue:str1,colValue:str2},function(){
				window.location.href='/jxcsxm/tjbb/qsptglxmsbcgsjczjqkb.do?'+data;
			 }); 
			 setTimeout('disLoadjzt()',4000);
		
	}

	function ghbb(){
		if(datalist==""|| datalist== undefined){
			alert("请您先查询报表数据");
			return;
		}else{
			YMLib.UI.createWindow('mywin',"固化版本","ghbb.jsp",'mywin','700','250');
		}


	}




	
	
	</script>
	<style type="text/css">
TD {
font-size: 12px;
}
a{
text-decoration:none;
}
.abgc_td td{padding-right:5px;}
</style>
</head>
<body>
	<div style="text-align: left; font-size: 12px; margin: 0px;">
		<table width="99.9%" border="0" style="margin-top: 1px; margin-left: 1px;" cellspacing="0" cellpadding="0">
			<tr>
					<div id="righttop" style="width:4020px;">
						<div id="p_top">当前位置>&nbsp;统计报表>&nbsp;全省普通公路项目省补、车购税结存资金情况单位统计表</div>
					</div>
        	</tr>
        	<tr>
        		<td align="left" style="padding-left: 10px; padding-right: 10px;">
        			<fieldset style="width:99.9%; text-align: left; vertical-align: middle;margin: 8px 0px 0px 0px;">
        				<legend style="padding: 0 0 0 0; font-weight: bold; color: Gray; font-size: 12px;">
        					<font style="color: #0866A0; font-weight: bold"></font>
        				</legend>
        				<div>
        					<table style="margin:7px; vertical-align:middle;" cellspacing="0" class="abgc_td" >
					
								<tr height="28">
<%--									<td align="right">行政区划：</td>--%>
<%--	        						<td><select id="xzqh" style="width:160px;"></select></td>--%>
									
									<td align="right">计划下达年份：</td>
        							<td><select id="jhnf" style="width: 150px;"></select></td>

									<td align="right">固化年月：</td>
        							<td><select id="ghny" style="width: 150px;"></select></td>
<%--        							<td align="right">项目等级：</td>--%>
<%--        							    <td><select id="xmdj" style="width: 120px;">--%>
<%--        							        <option value="" selected="selected">请选择</option>--%>
<%--        							        <option value="国省道">国省道</option>--%>
<%--        							        <option value="农村">农村</option>--%>
<%--        							        </select>--%>
<%--        							    </td>--%>
	        							
								</tr>
        					
<%--        					<tr height="28">--%>
<%--        					<td align="right">管养单位：</td>--%>
<%--       						<td><select id="gydw" style="width:160px;"></select></td>--%>
<%--							<td align="right">项目类型：</td>--%>
<%--      						<td><select id="xmlx" style="width: 100px;"></select></td>--%>
<%--							--%>
<%--     						<td align="right">报表时间：</td>	--%>
<%--     							<td><input type="text"  class='easyui-datebox'  id="bbsj" style="width: 118px;"></td>--%>
<%--       						--%>
<%--       						</tr>--%>
        					
        					<tr height="28">
                           	<td colspan="12">
                           		<a id='mybuttion1' style="margin-top: 1px;margin-bottom: 1px;" href="javascript:showBb(0)" onmouseover="szgq('button button-tiny button-glow button-rounded button-raised button-primary','mybuttion1')" onmouseout="szgq('button button-tiny button-rounded button-raised button-primary','mybuttion1')"  class="button button-tiny button-rounded button-raised button-primary">查询</a>
                           		<a id='mybuttion2' style="margin-top: 1px;margin-bottom: 1px;" href="javascript:exportBb()" onmouseover="szgq('button button-tiny button-glow button-rounded button-raised button-primary','mybuttion2')" onmouseout="szgq('button button-tiny button-rounded button-raised button-primary','mybuttion2')"  class="button button-tiny button-rounded button-raised button-primary">导出报表</a>
								<a id='mybuttion3' style="margin-top: 1px;margin-bottom: 1px;" href="javascript:ghbb()" onmouseover="szgq('button button-tiny button-glow button-rounded button-raised button-primary','mybuttion2')" onmouseout="szgq('button button-tiny button-rounded button-raised button-primary','mybuttion2')"  class="button button-tiny button-rounded button-raised button-primary">固化版本</a>
								<a id='mybuttion4' style="margin-top: 1px;margin-bottom: 1px;" href="javascript:showBb(2)" onmouseover="szgq('button button-tiny button-glow button-rounded button-raised button-primary','mybuttion2')" onmouseout="szgq('button button-tiny button-rounded button-raised button-primary','mybuttion2')"  class="button button-tiny button-rounded button-raised button-primary">固化查询</a>
							</td>
                            </tr>
							</table>
        				</div>
        			</fieldset>
        		</td>
        	</tr>
            <tr>
            	<td style="padding-top: 10px;padding-left:10px;padding-right:10px;">
                	<div id="gddiv" style="width:100%;height: 450px;" >
                		<script type="text/javascript">
                			// $("#gddiv").attr('style','width:1200px;height:'+($(window).height()-160)+'px;');
                		</script>
                		<div class="easyui-layout"  fit="true">
							<div data-options="region:'center',border:false" style="overflow:auto;">
							<table id='bbtable' width="100%">
								<caption align="top" style="font-size:large;font-weight: bolder;"> 全省普通公路项目省补、车购税结存资金情况单位统计表</caption>
								<tbody id='biaotou'>
									<tr>
										<td style='width:500px;' rowspan='3'  colspan='1'>地级市单位</td>
										<td style='width:130px;' rowspan='3'  colspan='1'>合计</td>
										<td style='width:130px;' rowspan='3'  colspan='1'>车购税小计</td>
										<td style='width:130px;' rowspan='3'  colspan='1'>省补小计</td>

										<td style='width:600px;' rowspan='1'  colspan='6'>项目状态</td>
										<td style='width:600px;' rowspan='1'  colspan='6'>计划年度</td>

									</tr>
									<tr>
										<td style='width:200px;' rowspan='1'  colspan='2'>在建</td>
										<td style='width:200px;' rowspan='1'  colspan='2'>已竣（完）工</td>
										<td style='width:200px;' rowspan='1'  colspan='2'>未开工</td>

										<td id="currYearTo2" style='width:120px;' rowspan='1'  colspan='2'>currYear-2+年及以前</td>
										<td id="currYearTo1" style='width:120px;' rowspan='1'  colspan='2'>currYear-1年</td>
										<td id="currYear"    style='width:120px;' rowspan='1'  colspan='2'>currYear年</td>
									</tr>

									<tr>

									<td style='width:100px;' >车购税</td>
									<td style='width:100px;' >省补</td>

									<td style='width:100px;' >车购税</td>
									<td style='width:100px;' >省补</td>

									<td style='width:100px;' >车购税</td>
									<td style='width:100px;' >省补</td>

									<td style='width:100px;' >车购税</td>
									<td style='width:100px;' >省补</td>

									<td style='width:100px;' >车购税</td>
									<td style='width:100px;' >省补</td>

									<td style='width:100px;' >车购税</td>
									<td style='width:100px;' >省补</td>


									</tr>

								</tbody>
								<tbody id="bblist"></tbody>
							</table>
							</div>
						</div>
					</div>
				</td>
			</tr>
		</table>
	</div>
</body>
</html>
